import Vue from "vue";
import Router from "vue-router";
import Home from "@/view/home/home";
import Login from "@/view/login";
import Signup from "@/view/signup";
// import navbar from '@/components/navbar'
import Layout from "@/layout";

Vue.use(Router);

export default [
  {
    path: "/login",
    name: "登录",
    component: Login,
    hidden: true
  },
  {
    path: "/signup",
    name: "注册",
    component: Signup,
    hidden: true
  },
  {
    path: "/",
    name: "首页",
    redirect: "/home",
    component: Home,
    hidden: true
  },
  {
    path: "/home",
    component: Home
  },
  {
    path: "/resources",
    component: Layout,
    children: [
      {
        path: "index",
        name: "资源管理",
        component: () => import("@/view/manage/resources/resources"),
        meta: { title: "资源管理", icon: "form" }
      }
    ]
  },
  {
    path: "/role",
    component: Layout,
    children: [
      {
        path: "index",
        name: "角色管理",
        component: () => import("@/view/manage/role/index"),
        meta: { title: "角色管理", icon: "form" }
      },
      {
        path: "distribution/:name",
        name: "分配资源",
        component: () => import("@/view/manage/role/distribution"),
        hidden: true
      }
    ]
  },
  {
    path: "/404",
    name: "error_404",
    component: () => import("@/view/404"),
    hidden: true
  },

  { path: "*", redirect: "/404", hidden: true }
];
